package top.oneit.jdownload.data.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.util.Date;

/**
 * @author lingkang
 * @date 2021/11/21
 */
@Getter
@Setter
@Table(name = "download_history")
@Entity
@org.hibernate.annotations.Table(appliesTo = "download_history", comment = "历史数据")
public class DownloadHistory {
    @Id
    @GeneratedValue(generator = "increment")
    @GenericGenerator(name = "increment", strategy = "increment")
    private Long id;

    @Column(length = 1024)
    private String url;

    @Column(length = 20, name = "request_method", columnDefinition = "varchar(20) comment 'GET、POST'")
    private String requestMethod;

    @OneToOne
    private DownloadParam downloadParam;

    @Column(length = 64)
    private String status;

    @Column
    private String remarks;

    @UpdateTimestamp
    @Column(name = "update_time")
    private Date updateTime;

    @CreationTimestamp
    @Column(name = "create_time")
    private Date createTime;
}
